package at.fhj.antesk.steamvaluecalc;

import java.math.BigDecimal;
import java.sql.Timestamp;

public class Game {

	private BigDecimal id;
	private String name;
	private String logo;
	private String storeLink;
	private Double hoursOnRecord;
	private Double price;
	private Double hourValue = 0.0;
	private String currency;
	private Integer discountPercent;
	private Double discountOriginalPrice;
	private Timestamp lastChecked;

	public Game(String name, String logo, String storeLink, double hoursOnRecord) {
		super();
		this.name = name;
		this.logo = logo;
		this.storeLink = storeLink;
		this.hoursOnRecord = hoursOnRecord;
	}

	public Game(BigDecimal id, String name, String logo, String storeLink, double hoursOnRecord) {
		super();
		this.id = id;
		this.name = name;
		this.logo = logo;
		this.storeLink = storeLink;
		this.hoursOnRecord = hoursOnRecord;
	}

	public Game(BigDecimal id, String name, String logo, String storeLink, double hoursOnRecord, double price, double hourValue,
			String currency, int discountPercent, double discountOriginalPrice, Timestamp lastChecked) {
		super();
		this.id = id;
		this.name = name;
		this.logo = logo;
		this.storeLink = storeLink;
		this.hoursOnRecord = hoursOnRecord;
		this.price = price;
		this.hourValue = hourValue;
		this.currency = currency;
		this.discountPercent = discountPercent;
		this.discountOriginalPrice = discountOriginalPrice;
		this.lastChecked = lastChecked;
	}

	public Game() {

	}

	public BigDecimal getId() {
		return id;
	}

	public void setId(BigDecimal id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLogo() {
		return logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	public String getStoreLink() {
		return storeLink;
	}

	public void setStoreLink(String storeLink) {
		this.storeLink = storeLink;
	}

	public Double getHoursOnRecord() {
		return hoursOnRecord;
	}

	public void setHoursOnRecord(Double hoursOnRecord) {
		this.hoursOnRecord = hoursOnRecord;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public Double getHourValue() {
		return hourValue;
	}

	public void setHourValue(Double hourValue) {
		this.hourValue = hourValue;
	}

	public String getCurrency() {
		return currency;
	}

	public void setCurrency(String currency) {
		this.currency = currency;
	}

	public Integer getDiscountPercent() {
		return discountPercent;
	}

	public void setDiscountPercent(Integer discountPercent) {
		this.discountPercent = discountPercent;
	}

	public Double getDiscountOriginalPrice() {
		return discountOriginalPrice;
	}

	public void setDiscountOriginalPrice(Double discountOriginalPrice) {
		this.discountOriginalPrice = discountOriginalPrice;
	}

	public Timestamp getLastChecked() {
		return lastChecked;
	}

	public void setLastChecked(Timestamp lastChecked) {
		this.lastChecked = lastChecked;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((currency == null) ? 0 : currency.hashCode());
		result = prime * result + ((discountOriginalPrice == null) ? 0 : discountOriginalPrice.hashCode());
		result = prime * result + ((discountPercent == null) ? 0 : discountPercent.hashCode());
		result = prime * result + ((hourValue == null) ? 0 : hourValue.hashCode());
		result = prime * result + ((hoursOnRecord == null) ? 0 : hoursOnRecord.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((lastChecked == null) ? 0 : lastChecked.hashCode());
		result = prime * result + ((logo == null) ? 0 : logo.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((price == null) ? 0 : price.hashCode());
		result = prime * result + ((storeLink == null) ? 0 : storeLink.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Game other = (Game) obj;
		if (currency == null) {
			if (other.currency != null)
				return false;
		} else if (!currency.equals(other.currency))
			return false;
		if (discountOriginalPrice == null) {
			if (other.discountOriginalPrice != null)
				return false;
		} else if (!discountOriginalPrice.equals(other.discountOriginalPrice))
			return false;
		if (discountPercent == null) {
			if (other.discountPercent != null)
				return false;
		} else if (!discountPercent.equals(other.discountPercent))
			return false;
		if (hourValue == null) {
			if (other.hourValue != null)
				return false;
		} else if (!hourValue.equals(other.hourValue))
			return false;
		if (hoursOnRecord == null) {
			if (other.hoursOnRecord != null)
				return false;
		} else if (!hoursOnRecord.equals(other.hoursOnRecord))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (lastChecked == null) {
			if (other.lastChecked != null)
				return false;
		} else if (!lastChecked.equals(other.lastChecked))
			return false;
		if (logo == null) {
			if (other.logo != null)
				return false;
		} else if (!logo.equals(other.logo))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (price == null) {
			if (other.price != null)
				return false;
		} else if (!price.equals(other.price))
			return false;
		if (storeLink == null) {
			if (other.storeLink != null)
				return false;
		} else if (!storeLink.equals(other.storeLink))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Game [id=" + id + ", name=" + name + ", logo=" + logo + ", storeLink=" + storeLink + ", hoursOnRecord="
				+ hoursOnRecord + ", price=" + price + ", hourValue=" + hourValue + ", currency=" + currency
				+ ", discountPercent=" + discountPercent + ", discountOriginalPrice=" + discountOriginalPrice + ", lastChecked="
				+ lastChecked + "]";
	}


}
